/*
 * InterfaceErrors.java
 *
 * $Id: InterfaceTraceabilityErrors.java,v 1.1 2008-06-26 10:42:17 mario Exp $
 */
package org.ceteca.explica.core.traceability;

import java.util.HashMap;

/**
 * Interface with the constant definition of the values used for
 * the result message construction.
 * It holds the error codes returned to the user.
 * <br/>
 * @author Mario García García <mario@imagos.es>
 * Copyright (c) 2007 Fundación Centro Tecnolóxico da Carne
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * <br/>
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * <br/>
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
public interface InterfaceTraceabilityErrors extends org.ceteca.explica.core.InterfaceErrors {
	/* ---------------------------------------------------------------------
	 * ---------------------------------------------------------------------
	 * ------------------------  ERROR CONSTANTS ---------------------------
	 * ---------------------------------------------------------------------
	 * ---------------------------------------------------------------------
	 */
	// Errors thrown during traceability file parsing
    public static final int ERR_TRACEABILITY_PARSING_EMPTY_TAG = 301;
    public static final int ERR_TRACEABILITY_PARSING_UNKNOWN_TAG = 302;
    public static final int ERR_TRACEABILITY_PARSING_UNEXPECTED_TAG = 303;
    public static final int ERR_TRACEABILITY_PARSING_GENERAL_ERROR = 304;
    public static final int ERR_TRACEABILITY_PARSING_INCORRECT_ITINERARY = 305;
    
    // Tree item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_OK = 311;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_NO_PARENT = 312;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_NO_PRODUCT_CHILD = 313;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_NO_PROCESS_CHILD = 314;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_NO_WAREHOUSE_CHILD = 315;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_ITEM_NO_CHILD = 316;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_ITEM_NO_DATA = 317;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_UNDEFINED = 318;
    
    // Tree product item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_REFERENCE = 321;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_SETNUMBER = 322;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_BARCODE = 323;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_DESCRIPTION = 324;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_INDATE = 325;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_EXPIRYDATE = 326;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_INDATE_AFTER_EXPIRYDATE = 327;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PRODUCT_TRFILENAME = 328;
    
    // Tree process item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROCESS_CODE = 331;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROCESS_DATE = 332;
    
    // Tree purchase item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PURCHASE_CODE = 341;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PURCHASE_SUPPLIER = 342;
    
    // Tree purchase item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_CODE = 351;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_DESCRIPTION = 352;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_TYPE = 353;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE = 354;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE_NOT_MATCH_TYPE = 355;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE_NOT_MATCH_PATTERN = 356;

    // Tree warehouse item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WAREHOUSE_CODE = 361;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WAREHOUSE_DESCRIPTION = 362;

    // Tree worker item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WORKER_CODE = 371;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WORKER_DESCRIPTION = 372;

    // Tree workcenter item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WORKCENTER_CODE = 381;
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_WORKCENTER_DESCRIPTION = 382;
    
    // Tree warehouse item validation errors
    public static final int ERR_TRACEABILITY_ITEM_VALIDATION_COMMENT = 391;

    
    /* ---------------------------------------------------------------------
	 * ---------------------------------------------------------------------
	 * ------------------------  ERROR MESSAGES ----------------------------
	 * ---------------------------------------------------------------------
	 * ---------------------------------------------------------------------
	 */
    
    //  Errors thrown during traceability file parsing
    public static final String MSG_TRACEABILITY_PARSING_EMPTY_TAG = "The name of the traceability file item is empty.";
    public static final String MSG_TRACEABILITY_PARSING_UNKNOWN_TAG = "";
    public static final String MSG_TRACEABILITY_PARSING_UNEXPECTED_TAG = "Item {0} unexpected.";
    public static final String MSG_TRACEABILITY_PARSING_GENERAL_ERROR = "Error parsing the traceability file: {0}";
    public static final String MSG_TRACEABILITY_PARSING_INCORRECT_ITINERARY = "";
    
    // Tree item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_OK = "The tree item is valid";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_NO_PARENT = "A tree item of type {0} cannot be the root item of the traceability tree.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_NO_PRODUCT_CHILD = "A tree item of type {0} cannot be inserted as a child of a product item. Only child items of type [PURCHASE, PROCESS, PROPERTY, WAREHOUSE, COMMENT] are admitted.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_NO_PROCESS_CHILD = "A tree item of type {0} cannot be inserted as a child of a process item. Only child items of type [PRODUCT, WORKER, WORKCENTER, COMMENT] are admitted.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_NO_WAREHOUSE_CHILD = "A tree item of type {0} cannot be inserted as a child of a warehouse item. Only child items of type [APPCC] are admitted.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_ITEM_NO_CHILD = "A tree item of type {0} cannot be inserted as a child of a {1} item. The items of type {1} don't admit any child item."; 
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_ITEM_NO_DATA = "No data has been typed in for the tree item.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_UNDEFINED = "The type of the item has not been specified.";
    
    // Tree product item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_REFERENCE = "The product's reference is not correct. Product reference must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_SETNUMBER = "The product's set number is not correct. Product set number must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_BARCODE = "The product's barcode is not correct. Product barcode must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_DESCRIPTION = "The product's description is not correct. Product description cannot be empty.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_INDATE = "The product's in date is not correct. Product in date must be a date value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_EXPIRYDATE = "The product's expiry date is not correct. Product expiry date must be a date value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_INDATE_AFTER_EXPIRYDATE = "The product expiry date cannot be previous to the in date.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PRODUCT_TRFILENAME = "The product's traceability filename is not correct. Traceability file cannot be found or cannot be opened. Check the traceability file exists and has the correct read/write permissions.";
    
    // Tree process item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROCESS_CODE = "The process's code is not correct. Process code must be an alphanumeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROCESS_DATE = "The process's date is not correct. Process date must be a date value.";
    
    // Tree purchase item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PURCHASE_CODE = "The purchase's code is not correct. Purchase code must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PURCHASE_SUPPLIER = "The purchase's supplier is not correct. Purchase supplier code must be a numeric value.";
    
    // Tree purchase item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_CODE = "The property's code is not correct. Property code must be an alphanumeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_DESCRIPTION = "The property's description is not correct. Property description cannot be empty.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_TYPE = "The property's type is not correct. Property type must be a valid item type value. Check the guide for allowed item types.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE = "The property's value is not correct. Property value cannot be empty.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE_NOT_MATCH_TYPE = "Type mismatch. The property's value does not fit the selected property type.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_PROPERTY_VALUE_NOT_MATCH_PATTERN = "The property's value does not match the selected property pattern.";

    // Tree warehouse item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WAREHOUSE_CODE = "The warehouse's code is not correct. Warehouse code must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WAREHOUSE_DESCRIPTION = "The warehouse's description is not correct. Warehouse description cannot be empty.";

    // Tree worker item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WORKER_CODE = "The worker's code is not correct. Worker code must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WORKER_DESCRIPTION = "The worker's name is not correct. Worker name cannot be empty.";

    // Tree workcenter item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WORKCENTER_CODE = "The workcenter's code is not correct. Workcenter code must be a numeric value.";
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_WORKCENTER_DESCRIPTION = "The workcenter's description is not correct. Workcenter description cannot be empty.";
    
    // Tree warehouse item validation errors
    public static final String MSG_TRACEABILITY_ITEM_VALIDATION_COMMENT = "The comment cannot be empty.";
}
